home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / boss_sup.zip / WINBOSS.H < prev    next >
Text File  |  1992-03-04  |  25KB  |  715 lines

  1. /*
  2. ** WINDOW BOSS - Simple but Elegant Window Functions 
  3. **
  4. ** Lattice, Computer Innovations, Microsoft, Datalight, Aztec, 
  5. ** Watcom, Mix Power C, Zortech
  6. **
  7. ** Copyright (c) 1984, 1985, 1986 - Philip A. Mongelluzzo
  8. ** All rights reserved.
  9. **
  10. ** The complex web of compiler defines and feature tests follows.
  11. */
  12.  
  13. /*
  14. ** Computer Innovations comes first....
  15. */
  16.  
  17. #ifdef C86
  18. #define BORLAND 0
  19. #define MSCV3   0
  20. #define MSCV4   0
  21. #define MSCV6   0
  22. #define MSC     0
  23. #define MSC3    0
  24. #define MSC4    0
  25. #define DLC     0
  26. #define CI86    1
  27. #define LC2     0
  28. #define LC3     0
  29. #define LC6     0
  30. #define __ZTC__ 0
  31. #define __TSC__ 0
  32. #define MIXPC   0
  33. #define AZTEC   0
  34. #define WATCOM  0
  35. #ifdef _C86_BIG
  36. #define LPTR    1
  37. #define SPTR    0
  38. #else
  39. #define LPTR    0
  40. #define SPTR    1
  41. #endif
  42. #define LATTICE 0
  43. #define void int                        /* define void as int */
  44. struct WORDREGS {                       /* register layout is */
  45.         unsigned int ax;                /* different from the rest !! */
  46.         unsigned int bx;
  47.         unsigned int cx;
  48.         unsigned int dx;
  49.         unsigned int si;
  50.         unsigned int di;
  51.         unsigned int ds;                /* <= NB */
  52.         unsigned int es;                /* <= NB */
  53.         unsigned int flags;
  54.         };
  55. struct BYTEREGS {
  56.         unsigned char al, ah;
  57.         unsigned char bl, bh;
  58.         unsigned char cl, ch;
  59.         unsigned char dl, dh;
  60.         };
  61. union REGS {
  62.         struct WORDREGS x;
  63.         struct BYTEREGS h;
  64.         };
  65. struct SREGS {
  66.         unsigned int cs;
  67.         unsigned int ss;
  68.         unsigned int ds;
  69.         unsigned int es;
  70.         };
  71. extern unsigned wns_mtype();            /* make everyone happy */
  72. #endif                                  /* end C86 Stuff */
  73.  
  74. /*
  75. ** Watcom Stuff 
  76. */
  77.  
  78. #if WATCOM
  79. #pragma aux v_kstat "_*" parm caller []                           \
  80.                          value struct float struct routine [ax]   \
  81.                          modify [ax bx cx dx es]; 
  82.  
  83. #pragma aux xferdata "_*" parm caller []                           \
  84.                          value struct float struct routine [ax]   \
  85.                          modify [ax bx cx dx es]; 
  86.  
  87. #pragma aux v_border "_*" parm caller []                           \
  88.                          value struct float struct routine [ax]   \
  89.                          modify [ax bx cx dx es]; 
  90.  
  91. #pragma aux _vidblt "_*" parm caller []                           \
  92.                          value struct float struct routine [ax]   \
  93.                          modify [ax bx cx dx es]; 
  94. #endif
  95.  
  96. #if WATCOM                              /* HUGE memory stuff... */
  97. #ifdef M_I86HM                          /* new with ver 8.5 */
  98. #define SPTR    0
  99. #define LPTR    1
  100. #endif
  101. #endif
  102.  
  103. /*
  104. ** TopSpeed C
  105. */
  106.  
  107. #if __TSC__
  108. #define MSCV4   1
  109. #ifdef M_I86XM                          /* (XLARGE) large code, large data */
  110. #define SPTR    0
  111. #define LPTR    1
  112. #endif
  113. #ifdef M_I86MTM                         /* (MTHREAD) large code, large data */
  114. #define SPTR    0
  115. #define LPTR    1
  116. #endif
  117. #endif
  118.  
  119. /*
  120. ** Microsoft 4.0, 5.X, 6.X, QuickC, PowerC
  121. */
  122.  
  123.  
  124. #if MSCV6
  125. #undef NULL                             /* NULL must be redefined */
  126. #define NULL (int)0                     /* to avoid useless errors MSC 6.XX */
  127. #define MSCV4   1
  128. #endif
  129.  
  130. #if MSCV4
  131. #define MSC     1
  132. #define MSCV3   0
  133. #define MSC4    1
  134. #define DLC     0
  135. #define CI86    0
  136. #define LC2     0
  137. #define LC3     0
  138. #define BORLAND 0
  139. #ifndef MIXPC
  140. #define MIXPC   0
  141. #endif
  142. #define AZTEC   0
  143. #ifdef M_I86SM                          /* small code, small data */
  144. #define SPTR    1
  145. #define LPTR    0
  146. #endif
  147. #ifdef M_I86LM                          /* large code, large data */
  148. #define SPTR    0
  149. #define LPTR    1
  150. #endif
  151. #ifdef M_I86CM                          /* small code, large data */
  152. #define SPTR    0
  153. #define LPTR    1
  154. #endif
  155. #ifdef M_I86MM                          /* large code, small data */
  156. #define SPTR    1
  157. #define LPTR    0
  158. #endif
  159. #define LATTICE 1
  160. #endif
  161.  
  162. /*
  163. ** Microsoft 3.00
  164. */
  165.  
  166. #if MSCV3
  167. #define MSC     1
  168. #define MSC4    0
  169. #define DLC     0
  170. #define CI86    0
  171. #define LC2     0
  172. #define LC3     0
  173. #define BORLAND 0
  174. #define MIXPC   0
  175. #ifndef AZTEC
  176. #define AZTEC   0
  177. #endif
  178. #ifdef M_I86SM                          /* small code, small data */
  179. #define SPTR    1
  180. #define LPTR    0
  181. #endif
  182. #ifdef M_I86LM                          /* large code, large data */
  183. #define SPTR    0
  184. #define LPTR    1
  185. #endif
  186. #ifdef M_I86CM                          /* small code, large data */
  187. #define SPTR    0
  188. #define LPTR    1
  189. #endif
  190. #ifdef M_I86MM                          /* large code, small data */
  191. #define SPTR    1
  192. #define LPTR    0
  193. #endif
  194. #define LATTICE 1
  195. #endif
  196.  
  197. /*
  198. ** Lattice 6.XX
  199. */
  200.  
  201. #if LC6                                 /* Lattice 6 looks like BORLAND! */
  202. #define BORLAND 1                       /* from a code standpoint */
  203. #undef NULL                             /* NULL must be redefined */
  204. #define NULL (int)0                     /* to avoid useless errors */
  205. #endif                                  /* any changes here must also */
  206.                                         /* be made in "windows.c" */
  207.  
  208. /*
  209. ** Zortech
  210. */
  211.  
  212. #if __ZTC__                             /* ZORTECH looks like BORLAND! */
  213. #define BORLAND 1                       /* from a code standpoint */
  214. #undef NULL                             /* NULL must be undefined */
  215. #endif                                  /* any changes here must also */
  216.                                         /* be made in "windows.c" */
  217. /*
  218. ** BORLAND
  219. */
  220.  
  221. #ifdef __TURBOC__
  222. #ifndef BORLAND
  223. #define BORLAND 1
  224. #endif
  225. #endif
  226.  
  227. #if BORLAND
  228. #define MSC     1
  229. #define MSC4    1
  230. #define DLC     0
  231. #define CI86    0
  232. #define LC2     0
  233. #define LC3     0
  234. #define MIXPC   0
  235. #define AZTEC   0
  236. #ifdef __SMALL__                        /* small code, small data */
  237. #define SPTR    1
  238. #define LPTR    0
  239. #endif
  240. #ifdef __LARGE__                        /* large code, large data */
  241. #define SPTR    0
  242. #define LPTR    1
  243. #endif
  244. #ifdef __COMPACT__                      /* small code, large data */
  245. #define SPTR    0
  246. #define LPTR    1
  247. #endif
  248. #ifdef __MEDIUM__                       /* large code, small data */
  249. #define SPTR    1
  250. #define LPTR    0
  251. #endif
  252. #ifdef __HUGE__                         /* large code, large data */
  253. #define SPTR    0
  254. #define LPTR    1
  255. #endif
  256. #define LATTICE 1
  257. #endif
  258.  
  259. #define TRUE    1                       /* truth */
  260. #define FALSE   0                       /* lies */
  261. #define The_BOSS TRUE                   /* convienent equate */
  262.  
  263. #include "stdio.h"                      /* standard header */
  264. #if CI86
  265. char *malloc(), *calloc();              /* for the OLD TIMER */
  266. #else
  267. #include "stdlib.h"                     /* For the rest */
  268. #endif
  269. #if LC6
  270. #include "string.h"                     /* Now for Lattice 6.XX */
  271. #endif
  272.  
  273. #if BORLAND | MSC | DLC | LC2 | LC3 | MIXPC | WATCOM | CI86
  274. #if AZTEC
  275. #else
  276. #include "dos.h"                        /* Lattice stuff */
  277. #endif
  278. #endif
  279. #include "ctype.h"                      /* character conversion stuff */
  280. #if MSC4
  281. #include "stdarg.h"                     /* variable arg list marcos */
  282. #include "string.h"                     /* added 12/26/90 for Topspeed */
  283. #endif
  284.  
  285. #if AZTEC                               /* AZTEC DOS.H */
  286.  
  287. struct WORDREGS {
  288.     unsigned int ax;
  289.     unsigned int bx;
  290.     unsigned int cx;
  291.     unsigned int dx;
  292.     unsigned int si;
  293.     unsigned int di;
  294.     unsigned int cflag;
  295.     };
  296.  
  297. struct BYTEREGS {
  298.     unsigned char al, ah;
  299.     unsigned char bl, bh;
  300.     unsigned char cl, ch;
  301.     unsigned char dl, dh;
  302.     };
  303.  
  304. union REGS {
  305.     struct WORDREGS x;
  306.     struct BYTEREGS h;
  307.     };
  308.  
  309. struct SREGS {
  310.     unsigned int cs;
  311.     unsigned int ss;
  312.     unsigned int ds;
  313.     unsigned int es;
  314.     };
  315.  
  316. #define FP_SEG(fp) (*((unsigned *)&(fp) + 1))
  317. #define FP_OFF(fp) (*((unsigned *)&(fp)))
  318.  
  319. struct RS {
  320.   int ax, bx, cx, dx, si, di, ds, es;
  321. };
  322. #endif                                  /* End AZTEC DOS.H */
  323.  
  324. #define SAVE    TRUE                    /* similar truth */
  325. #define RESTORE FALSE                   /* fibs */
  326. #define PAINT   TRUE                    /* screen update modes */
  327. #define FLASH   FALSE                   /* ditto */
  328. #define REPLACE 1                       /* for flicker free */
  329. #define ERASE   0                       /* scroll w_sapd & w_sapu */
  330. #define FAST    0x01                    /* fast retrace */
  331. #define SLOW    0x08                    /* slow retrace */
  332.  
  333. #define NULPTR  (char *) 0              /* null pointer */
  334. #define NUL     '\0'                    /* NUL char */
  335. #define NVAL    0                       /* null value - INTEGER */
  336. #define ECHO    0x8000                  /* echo disable bit */
  337.  
  338. #define BIOS    0x01                    /* BIOS Scrolling */
  339. #define DMAS    0x02                    /* The BOSS's DMA Scrolling */
  340.  
  341. #define MO_LEFT   0                     /* Mouse left button */
  342. #define MO_RIGHT  1                     /* Mouse right button */
  343. #define MO_HDW    1                     /* Mouse hardware */
  344. #define MO_SFT    0                     /* Mouse software */
  345.  
  346. #define WNTOPR  1                       /* top rigth */
  347. #define WNTOPL  2                       /* top left */
  348. #define WNTOPC  3                       /* top center */
  349. #define WNBOTR  4                       /* bottom right */
  350. #define WNBOTL  5                       /* bottom left */
  351. #define WNBOTC  6                       /* bottom center */
  352.  
  353. /*
  354. ** The following 2 equates are needed by Lattice Ver 2.XX (which is
  355. ** no longer "officially" supported.  Lattice Ver 2.XX users that need
  356. ** to work with larger Physical screens must change these constants here
  357. ** and in "windows.c". Other users can use the wns_ssiz() function.  Refer
  358. ** to wn_sup.c for usage.
  359. */
  360.  
  361. #define WN_MXROWS 25                    /* MAX PHYSICAL SCREEN */
  362. #define WN_MXCOLS 80                    /* MAX PHYSICAL SCREEN */
  363. #define MAXIMAGES 10                    /* MAX # of PUSH/POP IMAGES */      
  364.  
  365. #define BCUL  wns_bchars[0]             /* some shorthand for later */
  366. #define BCUR  wns_bchars[1]
  367. #define BCTB  wns_bchars[2]
  368. #define BCSD  wns_bchars[3]
  369. #define BCLL  wns_bchars[4]
  370. #define BCLR  wns_bchars[5]
  371.  
  372. /*
  373. ** HELP System Stuff
  374. */
  375.  
  376. #define HLPMAXKY 255                    /* ISAM file length (# of keys) */
  377. #define HLPKEYLN 25                     /* Maximum KEY length */
  378.  
  379. /*
  380. ** Misc Stuff
  381. */
  382.  
  383. #define WMR   wn->bsize                 /* shorthand */
  384.  
  385. typedef struct wcb                      /* Window control block */
  386. {
  387. int ulx,                                /* upper left corner x coordinate */
  388.     uly,                                /* upper left corner y coordinate */
  389.     xsize,                              /* width of window - INSIDE dimension */
  390.     ysize,                              /* height of window -INSIDE dimension */
  391.     ccx,                                /* virtual cursor offset in window */
  392.     ccy,
  393.     style,                              /* attribute to be used in window */
  394.     bstyle,                             /* border attribute */
  395.     bsize;                              /* total border size 0 or 2 only */
  396. char *scrnsave;                         /* pointer to screen save buffer */
  397. int page,                               /* current video page being used */
  398.     oldx,                               /* cursor position when window was */
  399.     oldy,                               /* opened (used for screen restore) */
  400.     wrpflg,                             /* wrap flag */
  401.     synflg;                             /* cursor sync flag */
  402. char *handle;                           /* my own id */
  403.     char *prevptr;                      /* linked list - previous */
  404.     char *nextptr;                      /* linked list - next */
  405.     unsigned tmpseg;                    /* for activate */
  406.     unsigned tmpoff;                    /* ditto */
  407.     int  smeth;                         /* scroll method to use */
  408.     int  shadow;                        /* shadow flag */
  409. char *rshwin;                           /* right shadow WINDOWPTR */
  410. char *bshwin;                           /* bottom shadow WINDOWPTR */
  411. } WINDOW, *WINDOWPTR;
  412.  
  413. typedef struct mcb                      /* Mouse control block */
  414. {
  415. int exists,                             /* TRUE if MOUSE exists */
  416.     nbuts,                              /* number of buttons */
  417.     bstat,                              /* button status */
  418.     nclik,                              /* number of clicks */
  419.     col,                                /* position - column */
  420.     row,                                /* position - row */
  421.     hmove,                              /* net horizontal movement */
  422.     vmove;                              /* net vertical movement */
  423.     char *handle;                       /* my own id */
  424. } MOUSE, *MOUSEPTR;         
  425.  
  426. union wi_args {                         /* variable arg type union */
  427.   int vi;                               /* (int) */
  428.   int *vip;                             /* (int *) */ 
  429.   unsigned int vui;                     /* (unsigned int) */
  430.   unsigned int *vuip;                   /* (unsigned int *) */
  431.   char vc;                              /* (char) */
  432.   char *vcp;                            /* (char *) */
  433.   char **vacp;                          /* array of char pointers */
  434.   long vl;                              /* (long) */
  435.   long *vlp;                            /* (long *) */
  436.   unsigned long vul;                    /* (unsigned long) */
  437.   unsigned long *vulp;                  /* (unsigned long *) */
  438.   float vf;                             /* (float) */
  439.   float *vfp;                           /* (float *) */
  440.   double vd;                            /* (double) */
  441.   double *vdp;                          /* (double *) */
  442.   unsigned char *vuc;                   /* (unsiged char) */
  443.   unsigned char *vucp;                  /* (unsigned char *) */
  444.   unsigned char **vaucp;                /* (unsigned array of char ptrs */
  445. } ;
  446.  
  447. typedef struct wi_scb {                 /* screen control block */
  448.   char *pself;                          /* pointer to myself */
  449.   int fcode;                            /* input funtion code */
  450.   WINDOWPTR wn;                         /* the window */
  451.   int row;                              /* window (wn) location - row */
  452.   int col;                              /* window (wn) location - col */
  453.   char *prmpt;                          /* prompt string for field */
  454.   unsigned int atrib;                   /* input field attribute */
  455.   char fill;                            /* input field fill character */
  456.   union wi_args v1;                     /* whatever */
  457.   union wi_args v2;                     /* whatever */
  458.   union wi_args v3;                     /* whatever */
  459.   union wi_args v4;                     /* whatever */
  460.   union wi_args v5;                     /* whatever */
  461.   union wi_args v6;                     /* whatever */
  462.   union wi_args v7;                     /* whatever */
  463.   union wi_args v8;                     /* whatever */
  464. } WIFLD, *WIFLDPTR, **WIFORM;
  465.  
  466.   struct mitem {                        /* POPUP menu item template */
  467.     int r;                              /* row */
  468.     int c;                              /* col */
  469.     char *t;                            /* text */
  470.     int rv;                             /* return value */
  471.   };
  472.  
  473.   struct pmenu {                        /* POPUP menu structure */
  474.     WINDOWPTR wpsave;                   /* place to hold window id */
  475.     int winopn;                         /* leave window open flag */
  476.     int lndx;                           /* last index */
  477.     int fm;                             /* first menu item index */
  478.     int lm;                             /* last menu item index */
  479.     struct mitem scrn[WN_MXROWS*4];     /* a bunch of menu items */
  480.   };                                    /* NOTE RELATIVE LIMIT */
  481.  
  482.   struct pditem {                       /* PULLDOWN menu item template */
  483.     int r;                              /* row */
  484.     int c;                              /* col */
  485.     char *t;                            /* text */
  486.     char hkc;                           /* hot key char */
  487.     int status;                         /* menu item status (active, inact) */
  488.     char type;                          /* menu item type (tog, extog) */
  489.     int rv;                             /* return value */
  490.   };
  491.  
  492. typedef struct pdmenu {                 /* PULLDOWN menu structure */
  493.     WINDOWPTR wpsave;                   /* place to hold window id */
  494.     int wa;                             /* window attribute */
  495.     int ba;                             /* border attribute */
  496.     int hka;                            /* hot key attribute */
  497.     int winopn;                         /* leave window open flag */
  498.     int lndx;                           /* last index */
  499.     int fm;                             /* first menu item index */
  500.     int lm;                             /* last menu item index */
  501.     struct pditem scrn[WN_MXROWS*4];    /* a bunch of menu items */
  502.   } WNPD, *WNPDPTR;                     /* NOTE RELATIVE LIMIT */
  503.  
  504.  
  505. #if MSCV3 | MSCV4 | BORLAND | DLC | LC3 /* allow for LINT_ARGS */
  506. #ifndef GENFNS
  507. #include "winboss.fns"                  /* enforce type checking */
  508. #endif
  509. #else                                   /* and almost lint args */
  510. struct wcb *wn_open();
  511. struct wcb *wn_move();
  512. struct wcb *wn_save();
  513. struct mcb *mo_reset();
  514. char *wn_gets();
  515. char *wn_sleftj();
  516. char *wn_srightj();
  517. char *wn_scenter();
  518. char *wn_sdelspc();
  519. struct wcb *wn_save();
  520. struct wi_scb * *wn_frmopn();
  521. unsigned int wns_mtype();
  522. #endif
  523.  
  524. #define BLACK   0x00                    /* foreground */
  525. #define RED     0x04                    /* background */
  526. #define GREEN   0x02                    /* colors */
  527. #define YELLOW  0x06                    /* bg << 4 | fg */
  528. #define BLUE    0x01
  529. #define MAGENTA 0x05
  530. #define CYAN    0x03
  531. #define WHITE   0x07
  532. #define BLINK   0x80
  533. #define BOLD    0x08
  534. #define NDISPB  0x00                    /* non display black */
  535. #define NDISPW  0x77                    /* non display white */
  536. #define RVIDEO  0x70                    /* reverse video */
  537. #define UNLINE  0x01                    /* under line (BLUE) */
  538.  
  539. #define NVIDEO  0x07                    /* normal video */
  540. #define NORMAL  0x03                    /* cyan is normal for me */
  541.  
  542. /*
  543. ** Display Mode Atributes
  544. */
  545.  
  546. #define B4025  0                        /* black & white 40 x 25 */
  547. #define C4025  1                        /* color 40 x 25 */
  548. #define B8025  2                        /* black & white 80 x 25 */
  549. #define C8025  3                        /* color 80 x 25 */
  550. #define C320   4                        /* color graphics 320 x 200 */
  551. #define B320   5                        /* black & white graphics */
  552. #define HIRES  6                        /* B&W hi res 640 * 200 */
  553. #define MONO   7                        /* monocrome 80 x 25 */
  554.  
  555. /*
  556. ** Key Scan Scodes & Window Input Stuff 
  557. */
  558.  
  559. #define LARROW          0x4b00          /* left arrow */
  560. #define RARROW          0x4d00          /* right arrow */
  561. #define DARROW          0x5000          /* down arrow */
  562. #define UARROW          0x4800          /* up arrow */
  563. #define CRARROW         0x7400          /* ^ right arrow */
  564. #define CLARROW         0x7300          /* ^ left arrow */
  565. #define BACKSPACE       0x0e08          /* Backspace */
  566. #define HOME            0x4700          /* home key */
  567. #define END             0x4f00          /* end key */
  568. #define INS             0x5200          /* insert key */
  569. #define DEL             0x5300          /* delete key */        
  570. #define PGUP            0x4900          /* pgup */  
  571. #define PGDN            0x5100          /* pgdn */
  572. #define F1              0x3b00          /* F1 aka HELP */
  573. #define HELP            F1              /* same as F1 */
  574. #define TAB             0x0f09          /* tab */
  575. #define BKTAB           0x0f00          /* back (shift) tab */
  576. #define SPACE           0x3920          /* space */        
  577. #define ESCAPE          0x011b          /* escape */
  578. #if __TSC__ 
  579. #define RETurn          0x1c0d          /* return for TopSpeed */
  580. #else
  581. #define RET             0x1c0d
  582. #define RETurn          RET
  583. #endif        
  584.  
  585. /*
  586. ** Character codes (non scan codes)
  587. */
  588.  
  589. #define BELL            0x07            /* ring a ding */
  590. #define BS              0x08            /* backspace */
  591. #define ESC             0x1b            /* Escape */
  592. #define CR              0x0d            /* carriage return */
  593. #define LF              0x0a            /* linefeed */
  594. #define RUB             0x7f            /* delete */
  595. #define NAK             0x15            /* ^U */
  596. #define ETX             0x03            /* ^C */
  597. #define CAN             0x18            /* ^X */
  598.  
  599. /*
  600. ** Special Cases
  601. */
  602.  
  603. #define Del             0x53            /* Del key scan code >> 8 */
  604. #define ESC_CODE  -2                    /* return code: ESCAPE - ESC.001 */
  605.  
  606. #define VIDEO 0x10                      /* for wn_bios */
  607. #define KBOARD 0x16                     /* and wn_mouse */
  608.  
  609. /*
  610. ** Data Clerk Stuff
  611. */
  612.                                         /* 0 to 100 are reserved!! */
  613. #define GDONE  0                        /* end of list */
  614. #define GDATE  10                       /* wn_gdate */
  615. #define GTIME  11                       /* wn_gtime */
  616. #define GINT   12                       /* wn_gint */
  617. #define GUINT  13                       /* wn_guint */
  618. #define GLONG  14                       /* wn_glong */
  619. #define GFLOAT 15                       /* wn_gfloat */
  620. #define GPHONE 16                       /* wn_gphone */
  621. #define GTEXT  17                       /* wn_gtext */
  622. #define GBOOL  18                       /* wn_gbool */
  623. #define DTEXT  19                       /* Display text only */
  624. #define GPWORD 20                       /* wn_gpword */
  625. #define GULONG 21                       /* wn_gulong */
  626. #define GDOUBL 22                       /* wn_gdouble */
  627. #define GUTEXT 23                       /* wn_gutext */
  628. #define GLTEXT 24                       /* wn_gltext */
  629. #define GATEXT 25                       /* wn_gatext */
  630. #define GEDATE 26                       /* wn_gedate */
  631. #define GSSN   27                       /* wn_gssn */
  632. #define GMLTEX 28                       /* wn_gmltex */
  633.                                         /* from above to 100 are reserved!! */
  634.  
  635. #define NSTR ""                         /* null string */
  636. #define NFRM (WIFORM)(0)                /* null form pointer */
  637. #define NFLD 0                          /* must be int 0 */
  638. #define SET  1                          /* form setup */
  639. #define XEQ  2                          /* immediate execution */
  640. #define MAXSTR 80                       /* max size - wn_gtext, wn_input */         
  641.  
  642. /*
  643. ** WN_PDOWN Stuff
  644. */
  645.  
  646. #define PDINACTIVE      0               /* Pdown menu INACTIVE */
  647. #define PDACTIVE        1               /* Pdown menu ACTIVE */
  648.  
  649. #define PDNORMAL        2               /* Pdown NORMAL display */
  650. #define PDREVERSE       3               /* Pdown REVERSE display */
  651.  
  652. #define PDTOGOK         -1              /* Pdown ok return value */
  653. #define PDACTION        10              /* Pdown menu ACTION type */
  654. #define PDSELECT        11              /* Pdown menu SELECTED type */
  655. #define PDBAR           12              /* Pdown menu BAR type */
  656. #define PDTOGG          13              /* Pdown menu TOGGLE */
  657. #define PDETOGG         14              /* Pdown menu EXCLUSIVE TOG */
  658.  
  659. /*
  660. ** Misc Stuff
  661. */
  662.  
  663. #define WNLPTR (WINDOWPTR) 0            /* A TRUE NULL WINDOW POINTER */
  664. #define MOLPTR (MOUSEPTR) 0             /* A TRUE NULL MOUSE POINTER */
  665. #define WNPDNL (WNPDPTR) 0              /* A TRUE NULL PULLDOWN POINTER */
  666.  
  667. /*
  668. ** FAR MEMORY MACROS
  669. */
  670.  
  671. #if MSCV3 | MSCV4
  672. #define FPSEG(fp) (*((unsigned *)&(fp) + 1))
  673. #define FPOFF(fp) (*((unsigned *)&(fp)))
  674. #endif
  675.  
  676. #if DLC
  677. #define FPOFF(fp) ((unsigned) ((char *)(fp) - (char *)0))
  678. #define FPSEG(fp) (((unsigned *) (&(fp)))[1])
  679. #endif
  680.  
  681. #if BORLAND 
  682. #define FPOFF(fp) ((unsigned)(fp))
  683. #define FPSEG(fp) ((unsigned)((unsigned long)(fp) >> 16))
  684. #endif
  685.  
  686. #if LC3
  687. #define FPOFF(fp) (unsigned)FP_OFF( (char far *) fp)
  688. #define FPSEG(fp) (unsigned)FP_SEG( (char far *) fp)
  689. #endif
  690.  
  691. #if CI86
  692. unsigned wns_off();
  693. unsigned wns_seg();
  694. unsigned long wns_gticks();
  695. #define intdos  sysint21
  696. #define int86 sysint
  697. #define int86x sysint
  698. #define FPOFF(fp) (unsigned)wns_off(fp)
  699. #define FPSEG(fp) (unsigned)wns_seg(fp)
  700. #endif
  701.  
  702. #if LC2
  703. #define FPOFF(fp) wns_off(fp)
  704. #define FPSEG(fp) wns_seg(fp)
  705. #endif
  706.  
  707. #ifndef N1ADE
  708. #include "winboss.ext"                  /* load externals */
  709. #endif
  710.  
  711. #define WNBDEBUG        FALSE           /* disable debugging */
  712.  
  713. /* End */
  714. 
  715.